Skip to content

Allow wildcard ("*") patterns in ambient module declarations #8939

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
5 commits merged into from
Jun 9, 2016

Conversation

ghost
Copy link

@ghost ghost commented Jun 2, 2016

Half of #6615

@ghost ghost force-pushed the pattern_ambient_modules branch from 7943883 to ff70666 Compare June 2, 2016 12:43
@ghost ghost force-pushed the pattern_ambient_modules branch from ff70666 to 3b19825 Compare June 2, 2016 12:44
@@ -2135,6 +2136,18 @@ namespace ts {
[index: string]: Symbol;
}

/** Represents a "prefix*suffix" pattern. */
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/* @internal */ as well

@mhegazy
Copy link
Contributor

mhegazy commented Jun 2, 2016

@vladima can you take a look?

@@ -17627,6 +17641,10 @@ namespace ts {
if (!isExternalOrCommonJsModule(file)) {
mergeSymbolTable(globals, file.locals);
}
if (file.patternAmbientModules && file.patternAmbientModules.length) {
(patternAmbientModules || (patternAmbientModules = [])).push(...file.patternAmbientModules);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i remember we had issues with this pattern for diagnostics, and concat fared better there. consider using patternAmbientModules = concatenate(patternAmbientModules , file.patternAmbientModules) instead.

@mhegazy
Copy link
Contributor

mhegazy commented Jun 8, 2016

Can you add a you add one more test with a relative file name:

declare module "*!text" { .. }

import f from "./file!text";

@mhegazy
Copy link
Contributor

mhegazy commented Jun 8, 2016

other than that 👍

@ghost ghost merged commit 9ffd00d into master Jun 9, 2016
@ghost ghost deleted the pattern_ambient_modules branch June 9, 2016 20:08
@microsoft microsoft locked and limited conversation to collaborators Jun 19, 2018
This pull request was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants